﻿<UserControl 
	x:Class="Week02Samples.SimpleBezier.Bezier"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:dxc="clr-namespace:SharpDX.WPF;assembly=SharpDX.WPF"
	xmlns:local="clr-namespace:Week02Samples.SimpleBezier"
	Foreground="Wheat"
	>
	<UserControl.Resources>

		<!-- the DirectX rendering context -->
		<local:Renderer x:Key="renderer"/>

	</UserControl.Resources>
    <Grid>
		<dxc:DXElement Renderer="{StaticResource renderer}"/>
		
		<StackPanel Orientation="Vertical" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="175" Margin="10">
			<TextBlock Text="{Binding PatchDivision, StringFormat='{}Patch Divisions: {0:0.0}', Source={StaticResource renderer}}"/>
			<Slider Minimum="4" Maximum="16" Value="{Binding PatchDivision, Source={StaticResource renderer}}"/>
			<CheckBox Content="Toggle Wires" IsChecked="{Binding ToggleWire, Source={StaticResource renderer}}"/>
			<Border Height="5"/>
			<ListBox
				ItemsSource="{Binding PModes, Source={StaticResource renderer}}"
				SelectedItem="{Binding PMode, Mode=TwoWay, Source={StaticResource renderer}}"/>
		</StackPanel>
	</Grid>
</UserControl>
